#ifndef _H_MAXIM
#define _H_MAXIM


#if 0
============== USE THESE VALUES IN TWIMASTER.CPP =============
#define F_CPU 16000000UL
/* I2C clock in Hz */
#define SCL_CLOCK  100000L
/* initialize TWI clock: 100 kHz clock, TWPS = 0 => prescaler = 1 */
  TWSR = 0;                         /* no prescaler */
============== USE THESE VALUES IN TWIMASTER.CPP =============
#endif

/*
  ================== Global Configuration

  Change these as you please
*/

// Limit on number of devices
#define MAXDEVICES 20           // 20 * 12 = 240 cells max.

// Minimum Threshold of Voltage Detection in ADC units
// to eliminate noise
#define ZERO_VOLTAGE_RESOLUTION_UNITS 0x11  // approx 0.02V

// How frequently to display all voltages in milliseconds
#define DISPLAY_FREQUENCY_MS 3000  // milliseconds

// What is the UnderVoltage SET Threshold (in voltage value)
#define UNDERVOLTAGE_SET_THRESHOLD 4.0

// What is the UnderVoltage CLEAR Threshold. 
// Must be HIGHER than the SET threshold
#define UNDERVOLTAGE_CLEAR_THRESHOLD 4.2

// What is the OverVoltage SET Threshold (in voltage value)
#define OVERVOLTAGE_SET_THRESHOLD 3.6

// CLEAR Threshold
// Must be LOWER than the SET Threshold
#define OVERVOLTAGE_CLEAR_THRESHOLD 3.5

/*
  ================== Maxim Commands

  Don't change these.
*/

// max cells per device
#define MAXDEVICECELLS 12

// Maxim's 12 bit ADC resolution
#define ADC_VOLTAGE_RESOLUTION  0.001221

#define HELLO_ALL_CMD 0xE0

// Register addresses -- should be converted to classes.
#define BROADCAST_ADDRESS 0x40
#define ROLLCALL_REGISTER 0x01



/*
  ================== Global variables
*/

//extern PackData g_packData;
//extern PrintBuf g_printer;

/*
  ================== prototype definitions
*/
// need to figure out where these come from
typedef uint8_t boolean;



#endif
